"use client";
import { useEffect, useRef } from "react";
import Amf from "@/lib/three/amf";

export default function Dashboard() {
  const canvasRef = useRef<HTMLDivElement>(null);

  const init = () => {
    if (canvasRef.current) {
      const three = new Amf(canvasRef.current, true);

      three.addStarSky();

      three.addGridGround();

      // three.addEvent();

      three.addGltf("/model/jushan.gltf");
      // three.addStl("/model/men.STL");
    }
  };

  useEffect(() => {
    init();
  }, []);

  return <div ref={canvasRef} className="h-screen w-screen bg-white"></div>;
}
